home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NetNews Offline 2
/
NetNews Offline Volume 2.iso
/
news
/
comp
/
std
/
c
/
306
< prev
next >
Wrap
Text File
|
1996-08-06
|
1KB
|
41 lines
Newsgroups: comp.std.c
Message-ID: <4esi6d$m3g@news.bmw.de>
From: frankro@bmw.de (Dr. R. Frank)
Path: news.bmw.de!usenet!frankro
Subject: Re: HELP!! Beginner's question...
Date: Fri, 02 Feb 1996 07:32:13 +0000
References: <Pine.OSF.3.91l.960131005708.7552A-100000@saul3.u.washington.edu>
X-Gateway: ZCONNECT XX ius.gun.de [UNIX/Connect v0.73]
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Ramon Mariano Jr <rmariano@u.washington.edu> wrote:
>Hello everybody!
>
>I'm a beginning C-programmer ...
>
>int main(void)
>{
> int i, /* integer */
> n, /* power to raise integer */
> i_total, /* integer's total value*/
> count; /* keeps track of number of loops run */
You must declare: int i, n, count;
but: long i_total;
>
> /* asks for an integer and stores it in 'i' */
.
.
.......
> for (count = 1; count <= n; count = count + 1){
> i_total = i_total * i;
you can write in C:
for (count = 1; count <= n; count++)
i_total *= i;
I hope, that this will help you!
Robert